package d8_generics_method;

import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        test("java");
        test(new Dog());

        ArrayList<Car> cars = new ArrayList<>();
        cars.add(new BENZ());
        cars.add(new BMW());
        go(cars);

        ArrayList<BMW> bmws = new ArrayList<>();
        bmws.add(new BMW());
        bmws.add(new BMW());
        go(bmws);


    }


    public static <T> T test(T t){
        System.out.println(t);
        return t;
    };

    public static <T extends Car> void go(ArrayList<T> t){

    }

    /**
     * 上面的等价写法
     * @param t
     */
    public static void go1(ArrayList<? extends Car> t){

    }

}
